package jdbc.mysql;

import java.sql.SQLException;

public class ConnMysql {

    public static void main(String[] args) throws SQLException {
        MysqlJdbcTest test = new MysqlJdbcTest();
        try {
            //test.query("select sysdate FROM DUAL",true);
            test.query(
                "CREATE FUNCTION MASK_STRING_SHADOW_HEAD_3(a_in_1 VARCHAR(1023))\n"
                    + "  RETURNS VARCHAR(1023)\n"
                    + "BEGIN\n"
                    + "  RETURN CONCAT(RPAD('*', LEAST(IFNULL(LENGTH(a_in_1), 0), 3), '*'), SUBSTR(a_in_1,4));\n"
                    + "END");
        } catch (SQLException e) {
            e.printStackTrace();
        }

        test.close();
    }
}
